package com.example.hellondk;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import android.opengl.GLSurfaceView.Renderer;

public class NdkGLRenderer implements Renderer {
	/* 
     * 声明了三个本地方法并且在Java中调用 
     * 
     */  
    native private void onNdkSurfaceCreated ();  
    native private void onNdkSurfaceChanged (int width, int height);  
    native private void onNdkDrawFrame      ();  
      
	@Override
	public void onSurfaceCreated(GL10 gl, EGLConfig config) {
		// TODO Auto-generated method stub
		onNdkSurfaceCreated ();  
	}

	@Override
	public void onSurfaceChanged(GL10 gl, int width, int height) {
		// TODO Auto-generated method stub
		onNdkSurfaceChanged (width, height);  
	}

	@Override
	public void onDrawFrame(GL10 gl) {
		// TODO Auto-generated method stub
		 onNdkDrawFrame ();   
	}

}
